package com.yanqu.road.server.manger.activity.recycle;

import com.yanqu.road.entity.activity.ActivityItemRecycleData;
import com.yanqu.road.entity.enums.eActivityType;
import com.yanqu.road.server.gameplayer.module.activity.goddess.GoddessConfig;
import com.yanqu.road.server.manger.activity.goddess.GoddessMgr;

import java.util.ArrayList;
import java.util.List;

public class GoddessRecycleStrategy extends AbstractItemRecycleStrategy {

    @Override
    public void markNeedRecycleItem() {
        GoddessConfig goddessConfig = GoddessMgr.getConfig();
        if(goddessConfig != null){
            // 体力道具换积分
            List<String> paramList = new ArrayList<>();
            long recycleTime = goddessConfig.getActivityInfo().getEndTime() * 1000L + 600 * 1000;
            paramList.add(String.valueOf(goddessConfig.getEnergyRecItemId()));
            paramList.add(String.valueOf(goddessConfig.getScoreItemId()));
            paramList.add("1");
            paramList.add(goddessConfig.getActivityInfo().getActivityName());
            ActivityItemRecycleMgr.addRecycleItemData(goddessConfig.getEnergyRecItemId(), activityType, 2, recycleTime, paramList);
        }
    }

    @Override
    protected void initActivityType() {
        this.activityType = eActivityType.GoddessActivity.getValue();
    }

    @Override
    protected void doRecycle(long userId, ActivityItemRecycleData data) {
        if (data.getRecycleType() == 2) {
            item2Score(userId, data);
        }
    }

    @Override
    public boolean isActivityRunning() {
        return false;
    }
}
